package com.prs.crm.dao.official.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.official.FileTransmitCollectTypeDao;
import com.prs.crm.domain.official.FileTransmitCollectType;

public class FileTransmitCollectTypeDaoImpl extends BaseDaoImpl<FileTransmitCollectType> implements FileTransmitCollectTypeDao{

	@Override
	public FileTransmitCollectType getFileTransmitCollectType(String type) {
		Criteria criteria=this.getSession().createCriteria(FileTransmitCollectType.class);
		criteria.add(Restrictions.eq("name", type));
		List result=criteria.list();
		if (result==null || result.size()==0) {
			return null;
		}
		return (FileTransmitCollectType) criteria.list().get(0);
	}

}
